package com.teapos.enumtype;

public enum ProductSortEnum {
	
	SHENGCHA(1, "生茶"),
	SHUCHA(2, "熟茶"),
	RUYAO(2, "汝窑"),
	LAOCHA(2, "老茶"),
	PIAOYIBEI(2, "飘逸杯"),
	ZISHAHU(2, "紫砂壶"),
	CHAJU(2, "茶具"),
	LIHE(2, "礼盒"),
	YANGANG(2, "烟缸");
	
	private int code;
	private String desc;
	private ProductSortEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static ProductSortEnum getEnumByCode(int code) {
		ProductSortEnum[] enums = ProductSortEnum.values();
		for(ProductSortEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
